import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'element-ui/lib/theme-chalk/index.css';
import ElementUI from 'element-ui';
import './assets/gloable.css'
import request from "@/utils/request";
import Vue2Editor from "vue2-editor";
Vue.config.productionTip = false

import preventReClick from "./utils/preventReClick"
//导入阿里图标
import './assets/icon/iconfont.css'
//导入jquery
import $ from 'jquery'
//引入element-ui
Vue.use(ElementUI, { size: "mini" });
Vue.use(Vue2Editor);
Vue.prototype.request=request
//导入公式
import katex from 'katex'
import 'katex/dist/katex.min.css'

window.katex = katex

//可能缺少store
new Vue({
  router,
  store,
  preventReClick,
  render: h => h(App)
}).$mount('#app')

//格式化时间
Date.prototype.Format = function (fmt) {
  const o = {
    'M+': this.getMonth() + 1, // 月份
    'd+': this.getDate(), // 日
    'h+': this.getHours(), // 小时
    'm+': this.getMinutes(), // 分
    's+': this.getSeconds(), // 秒
    'q+': Math.floor((this.getMonth() + 3) / 3), // 季度
    'S': this.getMilliseconds() // 毫秒
  }
  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length))
  for (let k in o) {
    if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
  }
  return fmt
}


